﻿using System.Xml;

namespace MingleReport
{
    public class StoryCard : IXmlNodeParser<StoryCard>
    {
        private string type;
        private string name;
        private string description;
        private string number;


        public StoryCard()
        {
        }

        public StoryCard(string type, string name, string description, string number)
        {
            this.type = type;
            this.name = name;
            this.description = description;
            this.number = number;
        }

        public string Type
        {
            get { return type; }
            set { type = value; }
        }

        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        public string Description
        {
            get { return description; }
            set { description = value; }
        }

        public string Number
        {
            get { return number; }
            set { number = value; }
        }

        public StoryCard ToObject(XmlNode node)
        {
            type = node["card_type_name"].InnerText;
            description = node["description"].InnerText;
            name = node["name"].InnerText;
            number = node["number"].InnerText;
            return this;
        }
    }

    public interface IXmlNodeParser<T>
    {
        T ToObject(XmlNode xmlNode);
    }
}